package cn.getech.data.development.mapper;

import cn.getech.data.development.entity.ProcUser;
import cn.getech.data.development.model.dto.ProcDatasDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 项目用户关系表 Mapper 接口
 * </p>
 *
 * @author wcj
 * @since 2019-10-29
 */
@Mapper
public interface ProcUserMapper extends BaseMapper<ProcUser> {
    IPage<Map<String,Object>> procUserList(Page<Map<String,Object>> page, @Param("params") Map<String, Object> params);


    /**
     * 获取该用户的所有
     * @param userId
     * @return
     */
    List<Integer> selectByUserId(@Param("userId") Long userId);
    List<Integer> selectProcIdsByUserIdAndTableId(@Param("userId") Long userId,@Param("tableId") Integer tableId);
    List<Long> selectByTableId(@Param("tableId") Integer tableId);
    List<Integer> procUserIdList(Integer procId);
    List<Integer> procIdListByUserId(@Param("userId")Integer userId, @Param("tenantId")Integer tenantId);

    List<ProcDatasDto> listProcUsers();

}
